package day10test01;

public class test02 {
    public static void main(String[] args) {
        String s = "If you want to change your fate I think you must come to the dark horse to learn java";
        String[] s1 = s.split(" ");
        int tocount = 0;
        int thinkcount = 0;
        int youcount = 0;
        for (int i = 0; i < s1.length; i++) {
            if (s1[i].equals("to")) {
                tocount++;
            }
            if (s1[i].equals("think")){
                thinkcount++;
            }
            if (s1[i].equals("you")){
                youcount++;
            }
        }
        System.out.println("to="+tocount);
        System.out.println("think="+thinkcount);
        System.out.println("you="+youcount);
    }
}
